// dlg.txt

begintalkscript;

variables;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(28,1) == 0;
	question = "special";
	text1 = "You enter a new section of this seemingly endless network of tunnels. Your journey here has taken you through abandoned mine shafts, abandoned clawbug tunnels, and a small amount of new excavations. This area is different.";
	text2 = "This complex is a mix of natural tunnels and human construction. It is old enough, however, that it is hard to tell which area is which. These tunnels are centuries old, perhaps even predating the arrival of the Shapers.";
	text3 = "Now it is a major juncture in the Shadow Road, and it is guarded. The silence of the caverns is gone, replaced by the echoing sounds of snarling patrols of creations.";
	text4 = "You don't just detect creations, though. You can feel powerful magic nearby. Something is happening down here, something beyond the mere transit of servile refugees.";
	text5 = "You see a path leading along the cave floor, marked with a dusting of gravel and two lines of stones. It seems to be there to direct travelers away from more dangerous areas.";
	action = SET_SDF 28 1 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(28,2) == 0;
	question = "special";
	text1 = "In the middle of this complex, you find a complicated bit of Shaping machinery. It's crude but powerful, probably not Shaper construction. It is rebel work, but surprisingly powerful for what it is guarding.";
	text2 = "A pool of essence roils and bubbles in the middle of the room, fed and charged by three crystal conduits. There are Shaping platforms around the pool, which restore and replace the guardians of the pathway.";
	text3 = "That means that this machinery is capable of creating a long flow of defenders to assault you. Unless you can get control, this is a very dangerous place to be.";
	action = SET_SDF 28 2 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(28,3) == 0;
	question = "special";
	text1 = "This servile was installing or maintaining the minefield here. He made a mistake while placing and activating a new mine. The error was fatal.";
	text2 = "You notice the glint of metal around his neck.";
	action = SET_SDF 28 3 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This crude sign says:";
	text2 = "  STAY ON THE PATH";


begintalknode 10; // cntrl panel
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "There is a control creation by the essence pools and Shaping platforms. You inspect the controls, trying to figure out how they work.";
	text2 = "They don't make any sense to you.";
	text3 = "You can't understand the switches and buttons that activate the machinery, but you can comprehend the parts that shut it down. Most devices of this sort give a way to turn them off in case of an emergency.";
	code =
		if (get_stat(21) >= 8)
			rs(2);
			else rs(3);
	break;
	
begintalknode 11;
	state = 10;
	nextstate = -1;
	condition = gf(28,6) == 0 && get_stat(21) >= 8 && (gf(28,7) + gf(28,8) + gf(28,9) < 3);
	question = "Call the creations back to this room. (Use 2 living tools.)";
	text1 = "In case any creations go rogue, one button makes it possible to give all of them a powerful command to stay in this chamber. You try to activate it, but it doesn't work. The control creature makes a little honking noise at you.";
	text2 = "It is possible that you can't use this control unless the system is already having problems.";

begintalknode 12;
	state = 10;
	nextstate = -1;
	condition = gf(28,5) == 0 && get_stat(21) >= 8 && (gf(28,7) + gf(28,8) + gf(28,9) < 2);
	question = "Stop new creations from being made. (Use 2 living tools.)";
	text1 = "In case the system gets low on essence or power, one switch makes it possible to cease the making of new creations. You try to activate it, but it doesn't work. The control creature makes a little honking noise at you.";
	text2 = "It is possible that you can't use this control unless the system is already having problems.";

begintalknode 13;
	state = 10;
	nextstate = -1;
	condition = gf(28,6) == 0 && get_stat(21) >= 8 && (gf(28,7) + gf(28,8) + gf(28,9) >= 3);
	question = "Call the creations back to this room. (Use 2 living tools.)";
	text1 = "In case any creations go rogue, one button makes it possible to give all of them a powerful command to stay in this chamber. You use your tools to activate it. The control creature makes a high, piercing noise.";
	text2 = "You don't have enough living tools.";
	code =
		if (num_of_item(255) < 2)
			rs(1);
			else {
				rs(2);
				take_item(255);
				take_item(255);
				sf(28,6,1);
				award_party_xp(100,20);
				}
	break;
	
begintalknode 14;
	state = 10;
	nextstate = -1;
	condition = gf(28,5) == 0 && get_stat(21) >= 8 && (gf(28,7) + gf(28,8) + gf(28,9) >= 2);
	question = "Stop new creations from being made. (Use 2 living tools.)";
	text1 = "In case the system gets low on essence or power, one switch makes it possible to cease the making of new creations. The control creature emits a little sigh and reduces the power flow to the essence pool.";
	text2 = "You don't have enough living tools.";
	code =
		if (num_of_item(255) < 2)
			rs(1);
			else {
				rs(2);
				take_item(255);
				take_item(255);
				sf(28,5,1);
				award_party_xp(100,20);
				}
	break;
	
begintalknode 15;
	state = 10;
	nextstate = -1;
	condition = gf(28,4) == 0 && get_stat(21) >= 8;
	question = "Weaken the creations. (Use 2 living tools.)";
	text1 = "You are able to reduce the power flow from the conduits to the platforms. Now that the guards are getting less power, they will hopefully be weaker.";
	text2 = "You don't have enough living tools.";
	code =
		if (num_of_item(255) < 2)
			rs(1);
			else {
				rs(2);
				take_item(255);
				take_item(255);
				sf(28,4,1);
				award_party_xp(100,20);
				}
	break;

begintalknode 16;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Leave the control panel alone.";
	text1 = "You stop fiddling with the control panel.";
	action = END_TALK;

//

begintalknode 30;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "One of the creations guarding this mine shaft sees you. It doesn't attack, at first. It looks at your chest. It spends several seconds staring at you, definitely looking for something. It doesn't see it.";
	text2 = "Then it attacks you.";

begintalknode 31;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "One of the creations guarding this mine shaft sees you. It doesn't attack. It looks at your chest and sees the amulet you are wearing. Then it looks at you, confused. You aren't who it expected to see.";
	text2 = "You try to take advantage of this delay and calm down the creature. You try soothing words and hand motions, but you just can't establish the right level of control. The creature attacks.";

begintalknode 32;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "One of the creations guarding this mine shaft sees you. It doesn't attack. It looks at your chest and sees the amulet you are wearing. Then it looks at you, confused. You aren't who it expected to see.";
	text2 = "You try to take advantage of this delay and calm down the creature. With soothing words and hand motions, you are able to calm it. It resumes guarding the tunnel.";

	
//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

	
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 53;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 54;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 55;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 56;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 57;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 58;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 59;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 60;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 61;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 62;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 63;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 64;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

//

begintalknode 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode 71;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

//

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode 91;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
		